/* 财联社电报展示页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 2rem;
}

.stats {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    background-color: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 4px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.controls button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.controls button:hover {
    background-color: #0056b3;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.controls select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.telegram-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.telegram-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.telegram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.telegram-time {
    color: #666;
    font-size: 0.9rem;
    font-weight: bold;
}

.telegram-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.telegram-content {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: justify;
}

.telegram-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.reading-count {
    background-color: #e9ecef;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.reading-count.high {
    background-color: #ffc107;
    color: #212529;
}

.reading-count.very-high {
    background-color: #dc3545;
    color: white;
}

.view-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.view-link:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.refreshing {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .stats {
        flex-direction: column;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls button, .controls label {
        width: 100%;
        justify-content: center;
    }
    
    .telegram-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .telegram-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 微信推送控制区域样式 - 折叠面板 */
.wechat-panel-container {
    position: relative;
    margin-bottom: 20px;
}

.wechat-panel-toggle {
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.wechat-panel-toggle:hover {
    background-color: #5a6fd5;
}

.toggle-icon {
    font-size: 16px;
}

.wechat-controls {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.wechat-controls.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.wechat-controls h2 {
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin: 0;
}

.panel-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.panel-close-btn:hover {
    color: #333;
}

.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 开关按钮样式 */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.toggle-switch label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    appearance: none;
    outline: none;
    transition: background-color 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked {
    background-color: #28a745;
}

.toggle-switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.toggle-switch span:last-child {
    font-size: 1rem;
    color: #333;
}

/* 群组配置样式 */
.group-config {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.group-config h3 {
    margin-bottom: 10px;
    color: #555;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.input-group button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.input-group button:hover {
    background-color: #218838;
}

#groups-list {
    margin-top: 10px;
}

#groups-list p {
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
}

#groups-ul {
    list-style-type: none;
    max-height: 200px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.group-name {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.remove-group-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.remove-group-btn:hover {
    background-color: #c82333;
}

.no-groups {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* 操作按钮样式 */
.test-btn, .save-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.test-btn {
    background-color: #ffc107;
    color: #212529;
    margin-right: 10px;
}

.test-btn:hover {
    background-color: #e0a800;
}

.save-btn {
    background-color: #007bff;
    color: white;
}

.save-btn:hover {
    background-color: #0056b3;
}

/* 状态消息样式 */
.status-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-message.sending {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* 微信状态显示样式 */
.status-enabled {
    color: #28a745;
    font-weight: bold;
}

.status-disabled {
    color: #6c757d;
}

.status-available {
    color: #28a745;
}

.status-unavailable {
    color: #dc3545;
}

/* 系统信息样式 */
.system-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 0.9rem;
}

.system-info p {
    font-weight: bold;
    margin-bottom: 5px;
    color: #495057;
}

.system-info ul {
    list-style-type: none;
}

.system-info li {
    margin-bottom: 3px;
    color: #6c757d;
}

/* 响应式适配 - 微信控制区域 */
@media (max-width: 768px) {
    .wechat-controls {
        padding: 15px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group button {
        width: 100%;
    }
    
    .test-btn, .save-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .toggle-switch {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stats {
        flex-direction: column;
        gap: 5px;
    }
}